package com.ruicar.afs.cloud.bizcommon.business.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.constant.CommonConstants;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @description: 贴息明细申请表
 * @author: sijun.yu
 * @date: 2020/5/11 18:04
 */
@Data
@TableName(value = "fin_discount_details", autoResultMap = true)
@Accessors(chain = true)
public class FinDiscountDetails  {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.INPUT)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 费用ID
     */
    private Long costId;
    /**
     * 费用类型
     */
    private String costType;
    /**
     * 申请编号
     */
    private String applyNo;
    /**
     * 贴息方ID
     */
    private String discountId;
    /**
     * 贴息方
     */
    private String discountParty;
    /**
     * 贴息比例
     */
    private BigDecimal discountScale;
    /**
     * 最高贴息额
     */
    private BigDecimal maxDiscountAmt;
    /**
     * 实际贴息金额
     */
    private BigDecimal discountAmt;
    /**
     * 总对总贴息
     */
    private String totalToTotal;
    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新人
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;
    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 删除标记
     */
    @TableLogic
    private String delFlag = CommonConstants.STATUS_NORMAL;

}
